package com.tengfei.main.meituan;

import java.util.Scanner;

/**
 * @author feige
 * @version v1.0
 * @date 2022-11-21-19:41
 * @description
 */
public class Qu1 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int len = sc.nextInt();
        String str = sc.next();
        int count = 0;
        while (true) {
            if (str.contains("atc")) {
                str = str.replaceFirst("atc", "cat");
                count++;
            } else {
                break;
            }
        }
        sc.close();
        System.out.println(count);
    }

}
